import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/views/Layout.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: '/layout',
    },
    {
      path: "/layout",
      component: Layout,
      children: [
        {
          path: "/layout/businessList",
          component: () => import('@/views/business/BusinessList.vue'),
        },
        {
          path: "/layout/shopList",
          component: () => import('@/views/shop/ShopList.vue'),
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue'),
    }
  ],
})

export default router
